import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login')
  },
  {
    path: '/',
    name: '首页',
    component: () => import('../views/Index'),
    children: [
      {
        path: 'users',
        name: 'users',
        component: () => import('../views/Users'),
        meta:{
          bread:['用户管理','用户列表']
        }
      },
      {
        path: 'roles',
        name: 'roles',
        component: () => import('../views/Roles'),
        meta:{
          bread:['权限管理','角色列表']
        }
      },
      {
        path: 'rights',
        name: 'rights',
        component: () => import('../views/Rights'),
        meta:{
          bread:['权限管理','权限列表']
        }
      },
      {
        path: 'goods',
        name: 'goods',
        component: () => import('../views/Goods'),
        meta:{
          bread:['商品管理','商品列表']
        }
      },
      {
        path: 'params',
        name: 'params',
        component: () => import('../views/Params'),
        meta:{
          bread:['商品管理','分类参数']
        }
      },
      {
        path: 'categories',
        name: 'categories',
        component: () => import('../views/Categories'),
        meta:{
          bread:['商品管理','商品分类']
        }
      },
      {
        path: 'orders',
        name: 'orders',
        component: () => import('../views/Orders'),
        meta:{
          bread:['订单管理','订单列表']
        }
      },
      {
        path: 'reports',
        name: 'reports',
        component: () => import('../views/Reports'),
        meta:{
          bread:['数据统计','数据报表']
        }
      },
      {
        path: '/',
        redirect: '/users'
      }
    ]
  },

];

const router = new VueRouter({
  routes
});

export default router;
